package com.hui.model.car;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 添加购物车CartParam
 */
@ApiModel(
        value = "CartParam (添加到购物车的参数信息)",
        description = "添加到购物车的参数信息"
)
@Data
public class CartParam implements Serializable {
    @Min(value = 1, message = "数量不在合法范围内")
    @Max(value = 9999, message = "数量不在合法范围内")
    //(value = "购物车数量")
    private Integer cartNum;

    //@JsonProperty 在反序列化的时候给属性重命名(多一个名字来识别)
    @JsonProperty(value = "new")
    @ApiModelProperty(value = "是否新购买")
    private Integer isNew = 0;

    @NotNull(message = "参数有误")
    @ApiModelProperty(value = "产品ID")
    private Long productId;

    //@NotBlank(message = "参数有误")
    @ApiModelProperty(value = "唯一的ID")
    private String uniqueId;

    @ApiModelProperty(value = "产品拼团ID")
    private Long combinationId = 0L;

    @ApiModelProperty(value = "产品秒杀ID")
    private Long secKillId = 0L;

    @ApiModelProperty(value = "产品砍价ID")
    private Long bargainId = 0L;
}
